package com.sfzy.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sfzy.entity.PsychReply;
import com.sfzy.mapper.PsychReplyMapper;
import com.sfzy.service.PsychReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName PsychReplyServiceImpl
 * @Description TODO
 * @Author niejiacan
 * @Date 2025年08月14日 9:34
 * @Version 1.0
 */
@Service
public class PsychReplyServiceImpl implements PsychReplyService {
    @Autowired
    private PsychReplyMapper psychReplyMapper;


    @Override
    public int addPsychReply(PsychReply psychReply) {
        return psychReplyMapper.addPsychReply(psychReply);
    }

    @Override
    public int updatePsychReply(PsychReply psychReply) {
        return psychReplyMapper.updatePsychReply(psychReply);
    }

    @Override
    public int deletePsychReply(int id) {
        return psychReplyMapper.deletePsychReply(id);
    }

    @Override
    public PsychReply selectPsychReply(int id) {
        return psychReplyMapper.selectPsychReply(id);
    }

    @Override
    public PageInfo<PsychReply> pageReplyContent(PsychReply psychReply, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<PsychReply> psychReplies = psychReplyMapper.pageReplyContent(psychReply);
        PageInfo<PsychReply> info = new PageInfo<>(psychReplies);
        return info;
    }
}
